﻿#include "FITKRadiossPostData.h"
#include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h"
#include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h"
#include "FITK_Interface/FITKInterfaceStructuralPost/FITKStruPost3DManager.h"

namespace Radioss
{

    FITKRadiossPostData::FITKRadiossPostData()
    {
        _post3DManager = new Interface::FITKStruPost3DManager;
    }

    FITKRadiossPostData::~FITKRadiossPostData()
    {
        //释放内存
        if (_post3DManager) delete _post3DManager;
    }

    FITKRadiossPostData* FITKRadiossPostData::GetDataFromAPPFrame()
    {
        if (FITKAPP == nullptr) return nullptr;
        auto  gloData = FITKAPP->getGlobalData();
        if (gloData == nullptr) return nullptr;
        //强制类型转换
        return gloData->getPostData<FITKRadiossPostData>();
    }

    Interface::FITKStruPost3DManager* FITKRadiossPostData::getPost3DManager()
    {
        return _post3DManager;
    }

    int FITKRadiossPostData::getCurrentPostDataID()
    {
        return _currentDataID;
    }

    void FITKRadiossPostData::setCurrentPostDataID(const int id)
    {
        _currentDataID = id;
    }

}
